<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:m="http://code.google.com/p/gmaps4jsf/" 
      xmlns:mashup="http://code.google.com/p/mashups4jsf/">

<ui:composition template="../templates/layout.xhtml">

        <ui:define name="title">Mashup Remix - 1</ui:define>
        <ui:define name="ajaxIncludes"></ui:define>
        
        <ui:define name="mashup">
          <h1>Drag the marker on the map to know the place name and weather information</h1>
                      
          <h:form id="form">
			<h:panelGrid columns="2" border="2" cellpadding="10px">
				<m:map width="500px" height="400px" 
					   latitude="40.730885" longitude="-73.997383" 
					   jsVariable="map1" zoom="5">
					    
					<m:marker id="marker1" jsVariable="marker1" draggable="true" 
							  valueChangeListener="#{theater1.processValueChangeForMarker}">		          
						
						<m:htmlInformationWindow htmlText="Drag Me, and I will show you the weather"/>
                        <f:ajax render="weatherSection"/>						
					</m:marker>    			
				</m:map>
				
				<h:panelGroup id="weatherSection">	
					<b>
						<h:outputText value="Weather Information:" rendered="#{theater1.address ne null}"/> <br />				
						<h:outputText value="Address: #{theater1.address}" rendered="#{theater1.address ne null}"/> <br />
						<h:outputText value="Location: #{theater1.location}" rendered="#{theater1.location ne null}"/> <br />	 
					</b>
					<b><h:outputText value="No weather information available as postal code is not specified for that location!!!" rendered="#{theater1.postalCode eq null}"/> </b> <br />
					<mashup:yahooWeather id="yahooWeather" 
										 locationCode="#{theater1.postalCode}" 
										 rendered="#{theater1.postalCode ne null}"
										 temperatureType="c"/>
					<br />
				</h:panelGroup>
			</h:panelGrid>	
           </h:form>         
        </ui:define>

</ui:composition>
</html>  
